package com.nbicc.news.controller;

import com.nbicc.common.ResponseObj;
import com.nbicc.news.po.NewsContent;
import com.nbicc.news.po.NewsInfo;
import com.nbicc.news.service.INewsContentService;
import com.nbicc.news.service.INewsInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

@ApiIgnore
@Api(value = "新闻内容" )
@RestController
@RequestMapping(value = "/news/content")
public class NewsContentController {

    @Resource(name = "NewsContentServiceImpl")
    private INewsContentService newsContentService;

    @ApiOperation(value = "按id查询新闻内容")
    @GetMapping("/id/{id}")
    @ResponseBody
    public ResponseObj selectById(@PathVariable Long id) throws Exception {
        NewsContent newsContent = newsContentService.selectById(id);
        return ResponseObj.success().setResult(newsContent);
    }

}
